def to_str(num, base):
    convert_string = '0123456789ABCDEF'

    if num < base:
        return convert_string[num]
    else:
        return to_str(num // base, base) + convert_string[num % base]


def practice(num, base):
    convert_string = '0123456789ABCDEF'

    if num < base:
        return convert_string[num]

    else:
        return practice(num // base, base) + convert_string[num % base]


if __name__ == "__main__":
    num = 1010
    print(practice(num, 5))